function cost = C_x(x_dot)

global gamma_x
global gamma_s
global delta
global alpha
global c_x_1
global c_x_2
global x
global s

state_dependent_term = max(gamma_x-x,0)-max(gamma_s-s,0);

cost = c_x_1*max(x_dot+delta,0) + c_x_2*max(x_dot+delta,0).^alpha+state_dependent_term.*max(x_dot+delta,0);

end

